<!-- Page structure, html and css coded by MJ Terrell -->
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Travel Experts</title>
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<%
String CustEmail = request.getParameter("user");
if (CustEmail != null){
String passwordT = request.getParameter("pass");

/* out.println("<h2> CustEmail </h2> " + CustEmail);
out.println("<h2> passwordT </h2> " + passwordT); */

if ((CustEmail.equals("") || passwordT.equals(""))){
out.println("<h2 style='color:red'> UserId and Password can not be blanks</h2>");
}
else{

    login.Login myLogin = new login.Login(CustEmail, passwordT);
     if (myLogin.login()){
    // System.out.println("customer id " + myLogin.CustomerIdR());
    // request.getSession().setAttribute("loggedin", true);
    String strCustId = myLogin.CustomerIdR();
   session.setAttribute("CustomerId",strCustId);
 //session.setAttribute("CustomerId", "104");
    response.sendRedirect("update.jsp");
    }else{
        out.println("<h2 style='color:red'> UserId and Password are invalid</h2>");
    }
}

}
%>

<div id="container">
            <div id="header">Travel Experts
                <div class="nav"><a href="index.jsp">Login</a>&nbsp;&nbsp |&nbsp;&nbspRegister&nbsp;&nbsp |
                    <a href="update.jsp">&nbsp;&nbsp Update</a>&nbsp;&nbsp; |
                    <a href="itinerary.jsp">&nbsp;&nbsp Itinerary</a></div>
<div class="login">

<div class="transbox">
<p style="opacity:1;">Login here</p>
<form style="font-family:Arial, Helvetica, sans-serif;">
Username: <input type="text" name="user" class="styled" />
Password: <input type="password" name="pass" />
<input type="submit" value="Login" id="btn" />
</form>
<p class="note">Don't have an account? <a href="register.jsp">Register now!</a></p>
</div> 
</div>
</div>
</body>
</html>

